<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
    <title>Document</title>
    <link rel="stylesheet" href="../css/newroom.css"/>
    <script src="../unis/jquery-1.8.3.min.js"></script>
    <script src="../interface/interface.js"></script>
    <style>
        .header img{width: 100%}
    </style>
</head>
<body>
<div class="content">
    <img class="bg" src="../imgs/mainBg.png" alt=""/>
    <div class="main">
        <div class="header">
            <img src="../imgs/default_avatar.png" alt=""/>
        </div>
        <div class="Id">
            <p><span id="Id_name"></span>   <span>ID:<span id="Id_id"></span></span></p>
            <div class="addfk">
                <img src="../imgs/fkbg.png" alt=""/>
                <p class="sum"></p>
            </div>
        </div>
        <div class="nav">
            <ul>
                <li>
                    <a href="##">
                        <img src="../imgs/battleBtn1.png" alt=""/>
                    </a>
                </li>
                <li>
                    <a href="jacascript:;">
                        <img src="../imgs/home_btn_4.png" alt=""/>
                    </a>
                </li>
                <li>
                    <a href="##">
                        <img onclick="mytest()" src="../imgs/wanfaBtn.png" alt=""/>
                    </a>
                </li>
                <li>
                    <a href="##">
                        <img src="../imgs/btnPhb.png" alt=""/>
                    </a>
                </li>
            </ul>
        </div>
        <div>
            <ul class="create">
                <li>
                    <img src="../imgs/btn_create.png" alt=""/>
                </li>
                <li>
                    <img src="../imgs/btn_join.png" alt=""/>
                </li>
            </ul>
        </div>
    </div>
    <div class="createroom" data="">
        <div class="bg">
            <img src="../imgs/create_room_bg.png" alt=""/>
        </div>
        <a class="Return" href="javascript:;">
            <img src="../imgs/btn_back2.png" alt=""/>
        </a>
        <div class="text">
            <div class="ionc">
                <img src="../imgs/btn_green3.png" alt=""/>
            </div>
            <div class="select">
                <ul>
                    <li>
                        <p>游戏选择： <img src="../imgs/cb1.png" alt=""/> 卡五星</p>
                    </li>
                    <li>
                        <p>局数选择： <img class="chekbox" bolen="true" src="../imgs/cb1.png"  number="8" alt=""/> 8局  <img class="chekbox" src="../imgs/cb0.png" number="16" alt=""/> 16局</p>
                    </li>
                    <li>
                        <p>玩法选择： <img src="../imgs/cb1.png" alt=""/> 襄阳玩法</p>
                    </li>
                </ul>
                <div class="createbtn" data="2">
                    <a href="javascript:;">
                        <img src="../imgs/btn_create2.png" alt=""/>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="Password" data="">
        <div class="showPassword">
            <ul>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
                <li class="showNumber"><img src="../imgs/btn_0.png" alt=""/></li>
            </ul>
        </div>
        <div class="bg">
            <img src="../imgs/joinRoomBg.png" alt=""/>
        </div>
        <a class="Return" href="##">
            <img src="../imgs/btn_back2.png" alt=""/>
        </a>
        <div class="setPassword">
            <ul>
                <li data="0">
                        <img  class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                        <img class="getNumber"  src="../imgs/btn_0.png" alt=""/>
                </li>

                <li data="1">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_1.png" alt=""/>
                </li>
                <li  data="2">
                    <img class="getpassword"  src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_2.png" alt=""/>
                </li>
                <li data="3">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_3.png" alt=""/>
                </li>
                <li data="4" >
                    <img class="getpassword"  src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_4.png" alt=""/>
                </li>
                <li data="5">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_5.png" alt=""/>
                </li>
                <li  data="6">
                    <img class="getpassword"  src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_6.png" alt=""/>
                </li>
                <li data="7">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_7.png" alt=""/>
                </li>
                <li  data="8">
                    <img class="getpassword"  src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_8.png" alt=""/>
                </li>
                <li data="9">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" src="../imgs/btn_9.png" alt=""/>
                </li>
                <li data="10">
                    <img class="getpassword"   src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" style="width: 50%;left:10%" src="../imgs/btn_delete.png" alt=""/>
                </li>
                <li  data="11">
                    <img class="getpassword"  src="../imgs/numBtnBg.png" alt=""/>
                    <img class="getNumber" style="width: 50%;left:10%" src="../imgs/reInput.png" alt=""/>
                </li>
            </ul>
        </div>
    </div>
</div>
</body>
<script src="../js/newRoom.js"></script>
<script src="../unis/jquery-1.8.3.min.js"></script>
<script src="../interface/interface.js"></script>
<script>

function mytest() {

    var is = check();
       if(is=="android") {
        android.jsCallJava2(11);
    }else{
        jsCallJavaios(11);
    }
  }

  /**
	 * 判断手机平台 ios 安卓
	 * return v;
	 */
	function check() {
		var ua = navigator.userAgent.toLowerCase();
		var v = null;
		if (/iphone|ipad|ipod/.test(ua)) {
			v = "iphone"
		} else if (/android/.test(ua)) {
			v = "android";
		}
		return v;
	}

    (function(){

        if(window.location.href.indexOf('token')== -1){

            var url = window.location.href.split('?')[0];
            window.location.href = url.replace('NewRoom','login');
        }
        if(window.location.href.indexOf('mid')==-1){
            var url = window.location.href.split('?')[0];
            window.location.href = url.replace('NewRoom','login');
        }
        var mid = window.location.href.split('?')[1].split('&')[0];
        var token = window.location.href.split('?')[1].split('&')[1];

        var opt = {
            url : 'http://mj.lcc.so/index',
            data : 'mid='+mid.split('=')[1]+'&token='+token.split('=')[1]
        };
        window.getData(opt,function(data){
            if(data.status==1){
                var member = data.member;
                $('.header img').attr('src',member.wxavatar);
                $('#Id_name').html(member.wxname);
                $('#Id_id').html(member.id);
                $('.sum').html(member.cardnum);
                var url = 'http://mj.lcc.so/game/create/'+member.id;
                $('.createroom').attr('data',url)
            }
            if(data.status == -1){
                var url = window.location.href.split('?')[0];
                window.location.href = url.replace('NewRoom','login');
            }
        })
    })(window)
</script>
</html>